Skip to content

feat: enumerate GpuInfo device_type and backend fields#158

Merged
DrKJeff16 merged 3 commits into
DrKJeff16:mainfrom
KevinSilvester:gpuinfo
Apr 15, 2026
Merged

feat: enumerate GpuInfo device_type and backend fields#158
DrKJeff16 merged 3 commits into
DrKJeff16:mainfrom
KevinSilvester:gpuinfo

Conversation

@KevinSilvester

@KevinSilvester KevinSilvester commented Apr 15, 2026

Copy link
Copy Markdown
Collaborator

Changes

  • Added enums for GpuInfo.backend and GpuInfo.device_type fields to reflect options supported by wgpu crate
  • Marked GpuInfo.driver and GpuInfo.driver_info fields as optional

Source(s)

GpuInfo is a trimmed-down lua conversion of the wgpu::AdapterInfo struct.

The enum fields of the struct, backend and device_type are defined as follows:

#[repr(u8)]
pub enum Backend {
    Noop = 0,
    Vulkan = 1,
    Metal = 2,
    Dx12 = 3,
    Gl = 4,
    BrowserWebGpu = 5,
}

#[repr(u8)]
pub enum DeviceType {
    Other = 0,
    IntegratedGpu = 1,
    DiscreteGpu = 2,
    VirtualGpu = 3,
    Cpu = 4,
}

In the new enums GpuInfo.Backend and GpuInfo.DeviceType, I've omitted a few fields that wgpu accepts, but WezTerm never uses.

  • Backend::Noop - a dummy backend for dev/testing purposes (ref)
  • Backend::BrowserWebGpu - when using WebGPU in the browser
  • DeviceType::VirtualGpu - for virtual/hosted gpus (ref)

And marked driver and driver_info fields as optional, as they may be nil if those fields contain an empty string in the original wgpu::AdapterInfo struct.

https://github.com/wezterm/wezterm/blob/577474d89ee61aef4a48145cdec82a638d874751/wezterm-gui/src/termwindow/webgpu.rs#L171-L189

Comment thread lua/wezterm/types/wezterm.lua Outdated
Comment thread lua/wezterm/types/wezterm.lua
Comment thread lua/wezterm/types/wezterm.lua Outdated
Comment thread lua/wezterm/types/wezterm.lua Outdated
@KevinSilvester KevinSilvester added enhancement New feature or request new-types A PR addresses new data types and/or fields labels Apr 15, 2026
@DrKJeff16 DrKJeff16 merged commit ffbef01 into DrKJeff16:main Apr 15, 2026
1 check passed
@DrKJeff16 DrKJeff16 added documentation Improvements or additions to documentation merged This PR has been merged successfully! labels Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request merged This PR has been merged successfully! new-types A PR addresses new data types and/or fields

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants